<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>


	<h:panelGrid id="productThemeProductInputPanel" columns="1"
		style="width:100%">
		<p:commandButton oncomplete="productDlg.show()" ajax="true"
			update=":dialogForm,:headerForm" icon="add"
			actionListener="#{productController.init}" value="Add"
			title="Add products" style="float:left"></p:commandButton>
		<p:dataTable var="product"
			value="#{productThemeModel.current.products}"
			filteredValue="#{productThemeModel.current.filteredProducts}"
			paginator="true" rows="20"
			rowsPerPageTemplate="5,7,10,15,20,30,40,50" filterEvent="enter"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			style="font-size:0.9em">
			<f:facet name="header">List of Products</f:facet>
			<p:column sortBy="#{product.id}" style="width:30px">
				<h:outputText value="#{productPrice.id}" />
			</p:column>
			<p:column style="width:20px">
				<f:facet name="header">
					<p:commandButton icon="delete" ajax="true" update=":detailForm"
						style="float:right"
						actionListener="#{productThemeController.removeSelectedProductsFromCurrent}"></p:commandButton>
				</f:facet>
				<p:selectBooleanCheckbox value="#{product.selected}"></p:selectBooleanCheckbox>
			</p:column>
			<p:column style="width:30px">
				<p:commandButton icon="edit" oncomplete="editProductInfoDlg.show()"
					ajax="true" update=":dialogForm">
					<f:setPropertyActionListener value="#{productPrice}"
						target="#{weeklyModel.currentProductPrice}" />
				</p:commandButton>
			</p:column>

			<p:column sortBy="#{product.number}" style="width:50px">
				<h:outputText value="#{product.number}" />
			</p:column>
			<p:column sortBy="#{product.chineseName}"
				filterBy="#{product.chineseName}" filterMatchMode="contains">
				<h:graphicImage library="images" value="../#{product.icon}16.png"></h:graphicImage>
				<h:outputText value="#{product.chineseName}" />
			</p:column>
			<p:column sortBy="#{product.name}" filterBy="#{product.name}"
				filterMatchMode="contains">
				<h:outputText value="#{product.name}" />
			</p:column>

			<p:column sortBy="#{product.type.label}"
				filterBy="#{product.type.label}" filterMatchMode="contains">
				<h:outputText value="#{product.type.label}" />
			</p:column>
			<p:column headerText="inventory" sortBy="#{product.inventory}"
				style="width:70px">
				<h:outputText value="#{product.inventory}" />
			</p:column>
			<p:column headerText="Stock Unit" sortBy="#{product.stockUnitLabel}"
				style="width:100px">
				<h:outputText value="#{product.stockUnitLabel}" />
			</p:column>
			<p:column headerText="Stock Unit Desc"
				sortBy="#{product.specificationDescLabel}" style="width:150px">
				<h:outputText value="#{product.specificationDescLabel}" />
			</p:column>
		</p:dataTable>
	</h:panelGrid>
</ui:composition>

</html>